<%@ page language="java" import="com.demo.util.Conn,java.sql.ResultSet" pageEncoding="UTF-8"%>
<%
String user_id = session.getAttribute("user_id").toString();
String sql = "select * from dbf_stuuser where STUUSER_ID=" + user_id;
Conn conn = new Conn();
ResultSet rs = conn.find(sql);
rs.next();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My resumes</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<link rel="stylesheet" type="text/css" href="../style.css">
  </head>
  
  <body>
  <table width="718" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="39" colspan="3" background="../images/main_title.jpg"><strong>&nbsp;&nbsp;&nbsp;&nbsp;<span class="menutitle">Resumes</span></strong></td>
    </tr>
	
    <tr>
      <td valign="bottom"><img src="../images/menu_a.jpg" width="19" height="23" /></td>
      <td valign="top">&nbsp;</td>
      <td valign="bottom"><img src="../images/menu_b.jpg" width="18" height="23" /></td>
    </tr>
    <tr>
      <td width="19" valign="top" background="../images/menu_c.jpg"><img src="../images/menu_c.jpg" width="19" height="54" /></td>
      <td width="681" valign="top"><form action="updateResume.jsp">
  	<table border="0" cellspacing="0" cellpadding="0" align="center" style="width:100%">
  		<tr>
  			<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="logintxt" style="width:100%">
              <tr>
  						<th colspan="4" style="background-color:#FFC963">Resumes Attachment</th>
  					</tr>
  					<tr>
  						<td colspan="4">
  							<%
  								String resumeFile = rs.getString("resume_file");
  								if (!"".equals(resumeFile) && resumeFile != null) {
  							%>
  								<a href="download_resume.jsp?fn=<%=resumeFile %>" title="Upload Attachment"><%=resumeFile %></a>
  							<%} %>
  							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  							<a href="upload_resume.jsp">Upload Attachment</a>
  						</td>
  					</tr>
  					<tr><td colspan="4">&nbsp;</td></tr>
			  <tr>
                <th colspan="4" style="background-color:#FFC963">Basic Information </th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <td width="16%">Name：</td>
                <td width="33%"><input type="text" name="uname" value="<%=rs.getString("name")==null ? "" : rs.getString("name") %>"/></td>
                <td width="15%">Gender：</td>
                <td width="36%"><input type="text" name="usex" value="<%=rs.getString("sex")==null ? "" : rs.getString("sex") %>"/></td>
              </tr>
              <tr>
                <td>Date of Birth ：</td>
                <td><input type="text" name="ubirthday" value="<%=rs.getString("birthday")==null ? "" : rs.getString("birthday") %>"/></td>
                <td>Address：</td>
                <td><input type="text" name="uaddress" value="<%=rs.getString("address")==null ? "" : rs.getString("address") %>"/></td>
              </tr>
              <tr>
                <td>Post Code ：</td>
                <td><input type="text" name="upostcode" value="<%=rs.getString("POSTCODE")==null ? "" : rs.getString("POSTCODE") %>"/></td>
                <td>Contact Number ：</td>
                <td><input type="text" name="uphone" value="<%=rs.getString("CONTACT_PHONE")==null ? "" : rs.getString("CONTACT_PHONE") %>"/></td>
              </tr>
              <tr>
                <td>Email：</td>
                <td><input type="text" name="uemail" value="<%=rs.getString("email")==null ? "" : rs.getString("email") %>"/></td>
                <td>Job Target ：</td>
                <td><input type="text" name="ujobtarget" value="<%=rs.getString("job_target")==null ? "" : rs.getString("job_target") %>"/></td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <th colspan="4" style="background-color:#FFC963">Education Background </th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <%
  						rs.close();
  						sql = "select * from dbf_education_background where STUUSER_ID=" + user_id;
						ResultSet rse = conn.find(sql);
						
						boolean next = rse.next();
  					%>
              <tr>
                <td nowrap>School：</td>
                <td><input type="text" name="euniversity" value="<%=next == true && rse.getString("university")!=null ? rse.getString("university") : "" %>"/></td>
                <td nowrap>Address：</td>
                <td><input type="text" name="elos" value="<%=next == true && rse.getString("locationofstudy")!=null ? rse.getString("locationofstudy") : "" %>"/></td>
              </tr>
              <tr>
                <td>Start Date ：</td>
                <td><input type="text" name="esd" value="<%=next == true && rse.getString("startdate")!=null ? rse.getString("startdate") : "" %>"/></td>
                <td>End Date ：</td>
                <td><input type="text" name="eed" value="<%=next == true && rse.getString("enddate")!=null ? rse.getString("enddate") : "" %>"/></td>
              </tr>
              <tr>
                <td>Degree：</td>
                <td><input type="text" name="edegree" value="<%=next == true && rse.getString("degree")!=null ? rse.getString("degree") : "" %>"/></td>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <th colspan="4" style="background-color:#FFC963">Working Experiment </th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <%
  						rse.close();
  						sql = "select * from dbf_businessexperience where STUUSER_ID=" + user_id;
						ResultSet rsb = conn.find(sql);
						
						next = rsb.next();
  					%>
              <tr>
                <td>Company：</td>
                <td><input type="text" name="bcompany" value="<%=next == true && rsb.getString("companyname")!=null ? rsb.getString("companyname") : "" %>"/></td>
                <td>Address：</td>
                <td><input type="text" name="blow" value="<%=next == true && rsb.getString("LocationOfWork")!=null ? rsb.getString("LocationOfWork") : "" %>"/></td>
              </tr>
              <tr>
                <td>Start Date ：</td>
                <td><input type="text" name="bstartdate" value="<%=next == true && rsb.getString("startdate")!=null ? rsb.getString("startdate") : "" %>"/></td>
                <td>End Date ：</td>
                <td><input type="text" name="benddate" value="<%=next == true && rsb.getString("enddate")!=null ? rsb.getString("enddate") : "" %>"/></td>
              </tr>
              <tr>
                <td>Post：</td>
                <td><input type="text" name="bph" value="<%=next == true && rsb.getString("PositionHeld")!=null ? rsb.getString("PositionHeld") : "" %>"/></td>
                <td>Department：</td>
                <td><input type="text" name="bdepartment" value="<%=next == true && rsb.getString("department")!=null ? rsb.getString("department") : "" %>"/></td>
              </tr>
              <tr>
                <td nowrap>Responsibility：</td>
                <td><input type="text" name="bra" value="<%=next == true && rsb.getString("responandachi")!=null ? rsb.getString("responandachi") : "" %>"/></td>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <th colspan="4" style="background-color:#FFC963">Professional and Certification </th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <%
  						rsb.close();
  						sql = "select * from dbf_proqua where STUUSER_ID=" + user_id;
						ResultSet rsp = conn.find(sql);
						
						next = rsp.next();
  					%>
              <tr>
                <td>Certification：</td>
                <td><input type="text" name="ptitle" value="<%=next == true && rsp.getString("title")!=null ? rsp.getString("title") : "" %>"/></td>
                <td>Awarded By：</td>
                <td><input type="text" name="pawardedby" value="<%=next == true && rsp.getString("AwardedBy")!=null ? rsp.getString("AwardedBy") : "" %>"/></td>
              </tr>
              <tr>
                <td>Organisation：</td>
                <td><input type="text" name="plor" value="<%=next == true && rsp.getString("LocationOfReceipt")!=null ? rsp.getString("LocationOfReceipt") : "" %>"/></td>
                <td>Year：</td>
                <td><input type="text" name="pyo" value="<%=next == true && rsp.getString("YearObtained")!=null ? rsp.getString("YearObtained") : "" %>"/></td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <th colspan="4" style="background-color:#FFC963">Awards</th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <%
  						rsp.close();
  						sql = "select * from dbf_awards where STUUSER_ID=" + user_id;
						ResultSet rsa = conn.find(sql);
						
						next = rsa.next();
  					%>
              <tr>
                <td>Awards：</td>
                <td><input type="text" name="award" value="<%=next == true && rsa.getString("Award")!=null ? rsa.getString("Award") : "" %>"/></td>
                <td>Theme：</td>
                <td><input type="text" name="ahost" value="<%=next == true && rsa.getString("host")!=null ? rsa.getString("host") : "" %>"/></td>
              </tr>
              <tr>
                <td>Address：</td>
                <td><input type="text" name="alocation" value="<%=next == true && rsa.getString("location")!=null ? rsa.getString("location") : "" %>"/></td>
                <td>Year：</td>
                <td><input type="text" name="ayb" value="<%=next == true && rsa.getString("YearObtained")!=null ? rsa.getString("YearObtained") : "" %>"/></td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <th colspan="4" style="background-color:#FFC963">Language</th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <%
  						rsa.close();
  						sql = "select * from dfb_languageskills where STUUSER_ID=" + user_id;
						ResultSet rsl = conn.find(sql);
						
						next = rsl.next();
  					%>
              <tr>
                <td>Language：</td>
                <td><input type="text" name="llanguage" value="<%=next == true && rsl.getString("Language")!=null ? rsl.getString("Language") : "" %>"/></td>
                <td>Spoken Proficiency：</td>
                <td><input type="text" name="lsp" value="<%=next == true && rsl.getString("SpokenProficiency")!=null ? rsl.getString("SpokenProficiency") : "" %>"/></td>
              </tr>
              <tr>
                <td>Written Proficiency：</td>
                <td><input type="text" name="lwp" value="<%=next == true && rsl.getString("WrittenProficiency")!=null ? rsl.getString("WrittenProficiency") : "" %>"/></td>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <th colspan="4" style="background-color:#FFC963">Computing Skill </th>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <%
  						rsl.close();
  						sql = "select * from dfb_computerskills where STUUSER_ID=" + user_id;
						ResultSet rsc = conn.find(sql);
						
						next = rsc.next();
  					%>
              <tr>
                <td>Proficiency（Level）：</td>
                <td><input type="text" name="cp" value="<%=next == true && rsc.getString("Proficiency")!=null ? rsc.getString("Proficiency") : "" %>"/></td>
                <td>Skills：</td>
                <td><input type="text" name="ccs" value="<%=next == true && rsc.getString("ComputerSkills")!=null ? rsc.getString("ComputerSkills") : "" %>"/></td>
              </tr>
              <tr>
                <td height="15" colspan="6" style="color:red;text-align:center">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="6"><div align="center">
                    <input name="submit" type="image" src="../images/submit_btn.jpg" value="update" />
                </div></td>
              </tr>
            </table></td>
		  </tr>
    </table>
  </form></td>
      <td width="18" valign="top" background="../images/menu_d.jpg"><img src="../images/menu_d.jpg" width="18" height="54" /></td>
    </tr>
    <tr>
      <td><img src="../images/menu_e.jpg" width="19" height="25" /></td>
      <td background="../images/menu_f.jpg"><img src="../images/menu_f.jpg" width="181" height="25" /></td>
      <td><img src="../images/menu_g.jpg" width="18" height="25" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
  
  </body>
</html>
